package game.core
{
	import engine.core.*;
	import engine.sound.*;
	import flash.net.*;
	import game.graphics.away3d.*;
	
	public class RxLocalSettings
	{
		private static const FILENAME:String = "KingsRoadSettings";
		
		public function RxLocalSettings()
		{
		}
		
		public static function GetObject() : SharedObject
		{
			var so:SharedObject;
			try
			{
				so = SharedObject.getLocal(FILENAME);
			}
			catch (e:Error)
			{
				so;
				RxLog.Info("Unable to create local settings object");
			}
			return so;
		}
		
		public static function WriteSettings() : void
		{
			var so:* = GetObject();
			if (so)
			{
				//so.data.soundDisabled = RxSoundChannel.IsMute(RxSoundChannel.TYPE_SOUND);
				//so.data.musicDisabled = RxSoundChannel.IsMute(RxSoundChannel.TYPE_MUSIC);
				so.data.graphicsQuality = RxRenderer.GetInstance().GetGraphicsQuality();
				try
				{
					so.flush();
				}
				catch (e:Error)
				{
					RxLog.Info("Unable to flush local settings object");
				}
			}
		}
	}
}